package com.ruoyi.manage.controller;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.cg.pojo.Group;
import com.ruoyi.common.core.cg.result.Queryparam;
import com.ruoyi.common.core.cg.result.Result;
import com.ruoyi.manage.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 马景昌
 * @create 2025/03/10
 * @description
 */
@RestController
@RequestMapping("/group")
public class GroupController {
    @Autowired
    private GroupService groupService;
    @GetMapping("/pageshow")
    public Result pageshow(Integer pageNum, Integer pageSize, Group group){
        Result pageshow = groupService.pageshow(pageNum, pageSize, group);
        return pageshow;
    }
//通过
    @PutMapping("/put0")
    public Result put0(@RequestBody Integer id){
        Result result = groupService.put0(id);
        return result;
    }
//    不通过
    @PutMapping("/put1")
    public Result put1(@RequestBody Integer id){
        Result result = groupService.put1(id);
        return result;
    }

    @RequestMapping("GroupApp")
    public PageInfo<Group> GroupApp(@RequestBody Queryparam queryparam){
        PageInfo<Group> pageInfo = groupService.GroupApp(queryparam);
        return pageInfo;
    }
//    配图回显
    @GetMapping("/{id}")
    public Result info(@PathVariable("id") Integer id){
        Result info = groupService.info(id);
        return info;
    }
    @GetMapping("/leadergroup")
    public Result leadergroup(Integer pageNum, Integer pageSize, Group group){
        Result leadergroup = groupService.leadergroup(pageNum, pageSize, group);
        return leadergroup;
    }

}
